<html><body><pre>
<h3> Android CMake Installation </h3>
This file gives instructions on how to properly setup your NDK for cmake.
<h3> Requirements </h3>
 * android ndk r5b
 * android sdk
 * ant -- for command line build of android projects

These instructions will work on Linux, but may work on Mac OSX 
or Windows with slight modification.

android-ndk-r5b can be found here:
<a href="http://developer.android.com/sdk/ndk/index.html">
http://developer.android.com/sdk/ndk/index.html</a>

Read its documentation, specifically the Standalone Toolchain.

Assumming you read the documentation, follow steps for creating a standalone
toolchain.
  export NDK=~/android-ndk-r5b
  $NDK/build/tools/make-standalone-toolchain.sh --platform=android-5 \
    --install-dir=$HOME/android-toolchain

android-sdk can be found here:
<a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a>
Please install that, and add it to your path.
  ANDROID_SDK=~/android-sdk-linux_86
  export PATH=$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$PATH

Lets try the <a href="hello-cmake.html">hello-cmake</a> sample.
<h3> Ubuntu Quick Start </h3>
Lets assume you have ANDROID_CMAKE pointing to the android-cmake directory.
Export a working directory, this will be where the script downloads the ndk to
  WORK=$HOME

This will pull down the ndk r5, and setup a NDK standalone toolchain:
  cd $ANDROID_CMAKE/scripts
  ./get_ndk_toolchain_linux.sh $WORK

Add the toolchain location to your bashrc or otherwise export it to your env:
  echo export ANDTOOLCHAIN=$ANDROID_CMAKE/toolchain/android.toolchain.cmake >> $HOME/.bashrc

Now when you re-source your bashrc, you can run cmake with the toolchain:
  cd $MY_CMAKE_PROJECT
  mkdir build
  cd build
  cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN ..
<h3> alias trick </h3>
Add these lines to your bashrc:
  export ANDTOOLCHAIN=$ANDROID_CMAKE/toolchain/android.toolchain.cmake
  alias android-cmake='cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN '

Then to run cmake for android do:
  cd $MY_CMAKE_PROJECT
  mkdir build
  cd build
  android-cmake ..

</pre></body></html>
